package com.zpark.controller;

import com.zpark.pojo.Ranking;
import com.zpark.service.IRankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author xiaoyu
 * @version 1.0 2022/11/8
 */
@RestController
@RequestMapping("/service")
public class UserController {

    @Autowired
    private IRankingService rankingService;

    @PostMapping("/all")
    public List<Ranking> findAll() {
        return rankingService.selectAll();
    }

    @GetMapping("/find_by_id/{id}")
    public Ranking findById(@PathVariable Integer id) {
        return rankingService.selectById(id);
    }
}
